package com.sfx.concurrent.demo.concurrent.pattern.GuardedObjectEncapsulationTest;

import lombok.extern.slf4j.Slf4j;

/**
 * Created with IntelliJ IDEA.
 * Description: 人线程用于收信
 * User: sfx
 * Date: 2023-01-01
 * Time: 10:28
 */

@Slf4j(topic = "c.People")
public class People extends Thread {
    @Override
    public void run() {
        GuardedObject guardedObject = MailBoxes.createGuardedObject();
        log.debug("开始收信 : id{}",guardedObject.getId());
        String mail = (String) guardedObject.get(2000);
        log.debug("收到信id{},mail{}",guardedObject.getId(),mail);
    }
}